package com.kun.demo03;

import org.junit.Test;

public class TestJoin implements Runnable{
    @Override
    public void run() {
        for(int i=0;i<1000;i++){
            System.out.println("线程vip---" + i);
        }
    }

    @Test
    public void testJoin() throws InterruptedException {
        Thread t1 = new Thread(this);
        t1.start();

        for (int i = 0; i < 500; i++) {
            System.out.println("主线程---" + i);
            if (i == 1){
                t1.join();
            }
        }
    }
}
